From 4869c56712d397010997809861616380e914bd8a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 26 Dec 2008 05:28:07 +0000 Subject: [PATCH] Revert r45021, r45022, r45023 -- restoring r44896, r44927, r44896 -- pending further discussion of what, if anything, is wrong with our ID generation. Given that the section IDs are meant to be valid IDs (as required per spec), and that in production they are already put out as IDs due to Tidy's behavior, the only change necessary to provide the fix (if fix is necessary in fact) would be to fix our ID normalization. --- RELEASE-NOTES | 2 + includes/Linker.php | 2 +- maintenance/parserTests.txt | 122 ++++++++++++++++++------------------ 3 files changed, 64 insertions(+), 62 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 9e9c4c6ecd..4f050389cf 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -442,6 +442,8 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16712) Special:NewFiles updated to use "newer"/"older" paging messages for clarity over "previous/next" * (bug 16612) Fixed "noprint" class for Modern skin print style +* Section anchors now have an "id" attribute as well as a "name" attribute, + even when Tidy is not used * (bugs 212, 16026) revision-info, revision-info-current, cannotdelete, redirectedfrom, historywarning, difference, summary and subject messages now use Wiki text rather than raw HTML markup diff --git a/includes/Linker.php b/includes/Linker.php index 7c52476ad3..870112efa9 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1519,7 +1519,7 @@ class Linker { * @return string HTML headline */ public function makeHeadline( $level, $attribs, $anchor, $text, $link ) { - return "$text"; + return "$text"; } /** diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 40377ffa87..44fe01f2d1 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -2681,8 +2681,8 @@ Bug 6563: Edit link generation for section shown by !! input {{includeonly section}} !! result -

[edit] Includeonly section

-

[edit] Section T-1

+

[edit] Includeonly section

+

[edit] Section T-1

!! end @@ -2708,7 +2708,7 @@ Bug 6563: Edit link generation for section suppressed by ==Section 1== !! result -

[edit] Section 1

+

[edit] Section 1

!! end @@ -3523,13 +3523,13 @@ More ===Smaller headline=== Blah blah !! result -

[edit] Headline 1

+

[edit] Headline 1

Some text

-

[edit] Headline 2

+

[edit] Headline 2

More

-

[edit] Smaller headline

+

[edit] Smaller headline

Blah blah

!! end @@ -3568,14 +3568,14 @@ Some text -

[edit] Headline 1

-

[edit] Subheadline 1

-
[edit] Skipping a level
-
[edit] Skipping a level
-

[edit] Headline 2

+

[edit] Headline 1

+

[edit] Subheadline 1

+
[edit] Skipping a level
+
[edit] Skipping a level
+

[edit] Headline 2

Some text

-

[edit] Another headline

+

[edit] Another headline

!! end @@ -3623,16 +3623,16 @@ Handling of sections up to level 6 and beyond -

[edit] Level 1 Heading

-

[edit] Level 2 Heading

-

[edit] Level 3 Heading

-

[edit] Level 4 Heading

-
[edit] Level 5 Heading
-
[edit] Level 6 Heading
-
[edit] = Level 7 Heading=
-
[edit] == Level 8 Heading==
-
[edit] === Level 9 Heading===
-
[edit] ==== Level 10 Heading====
+

[edit] Level 1 Heading

+

[edit] Level 2 Heading

+

[edit] Level 3 Heading

+

[edit] Level 4 Heading

+
[edit] Level 5 Heading
+
[edit] Level 6 Heading
+
[edit] = Level 7 Heading=
+
[edit] == Level 8 Heading==
+
[edit] === Level 9 Heading===
+
[edit] ==== Level 10 Heading====
!! end @@ -3665,12 +3665,12 @@ TOC regression (bug 9764) -

[edit] title 1

-

[edit] title 1.1

-

[edit] title 1.1.1

-

[edit] title 1.2

-

[edit] title 2

-

[edit] title 2.1

+

[edit] title 1

+

[edit] title 1.1

+

[edit] title 1.1.1

+

[edit] title 1.2

+

[edit] title 2

+

[edit] title 2.1

!! end @@ -3701,12 +3701,12 @@ wgMaxTocLevel=3 -

[edit] title 1

-

[edit] title 1.1

-

[edit] title 1.1.1

-

[edit] title 1.2

-

[edit] title 2

-

[edit] title 2.1

+

[edit] title 1

+

[edit] title 1.1

+

[edit] title 1.1.1

+

[edit] title 1.2

+

[edit] title 2

+

[edit] title 2.1

!! end @@ -3716,8 +3716,8 @@ Resolving duplicate section names == Foo bar == == Foo bar == !! result -

[edit] Foo bar

-

[edit] Foo bar

+

[edit] Foo bar

+

[edit] Foo bar

!! end @@ -3727,8 +3727,8 @@ Resolving duplicate section names with differing case (bug 10721) == Foo bar == == Foo Bar == !! result -

[edit] Foo bar

-

[edit] Foo Bar

+

[edit] Foo bar

+

[edit] Foo Bar

!! end @@ -3747,10 +3747,10 @@ __NOTOC__ {{sections}} ==Section 4== !! result -

[edit] Section 0

-

[edit] Section 1

-

[edit] Section 2

-

[edit] Section 4

+

[edit] Section 0

+

[edit] Section 1

+

[edit] Section 2

+

[edit] Section 4

!! end @@ -3761,8 +3761,8 @@ __NOEDITSECTION__ ==Section 1== ==Section 2== !! result -

Section 1

-

Section 2

+

Section 1

+

Section 2

!! end @@ -3771,7 +3771,7 @@ Link inside a section heading !! input ==Section with a [[Main Page|link]] in it== !! result -

[edit] Section with a link in it

+

[edit] Section with a link in it

!! end @@ -3793,9 +3793,9 @@ __TOC__
  • 2 title 2
  • -

    [edit] title 1

    -

    [edit] title 1.1

    -

    [edit] title 2

    +

    [edit] title 1

    +

    [edit] title 1.1

    +

    [edit] title 2

    !! end @@ -4963,7 +4963,7 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! result -

    [edit] onmouseover=

    +

    [edit] onmouseover=

    http://

    Contents

    • 1 onmouseover=
    • @@ -4978,7 +4978,7 @@ Fuzz testing: Parser14-table ==a== {| STYLE=__TOC__ !! result -

      [edit] a

      +

      [edit] a

      @@ -6561,7 +6561,7 @@ Inclusion of !userCanEdit() content !! input {{MediaWiki:Fake}} !! result -

      [edit] header

      +

      [edit] header

      !! end @@ -6592,12 +6592,12 @@ Out-of-order TOC heading levels
    -

    [edit] 2

    -
    [edit] 6
    -

    [edit] 3

    -

    [edit] 1

    -
    [edit] 5
    -

    [edit] 2

    +

    [edit] 2

    +
    [edit] 6
    +

    [edit] 3

    +

    [edit] 1

    +
    [edit] 5
    +

    [edit] 2

    !! end @@ -6843,7 +6843,7 @@ language=sr variant=sr-ec !! input == -{Naslov}- == !! result -

    [уреди] Naslov

    +

    [уреди] Naslov

    !! end @@ -6982,7 +6982,7 @@ Morwen/13: Unclosed link followed by heading !! result

    [[link

    -

    [edit] heading

    +

    [edit] heading

    !! end @@ -6994,7 +6994,7 @@ HHP2.1: Heuristics for headings in preprocessor parenthetical structures !! result

    {{foo|

    -

    heading

    +

    heading

    !! end @@ -7006,7 +7006,7 @@ HHP2.2: Heuristics for headings in preprocessor parenthetical structures !! result

    {{foo|

    -

    [edit] heading

    +

    [edit] heading

    !! end -- 2.20.1